<template>
  <div class="card content-box">
    <span class="text">防抖指令 🍇🍇🍇🍓🍓🍓</span>
    <el-button v-debounce="debounceClick" type="primary"> 防抖按钮 (0.5秒后执行)</el-button>
  </div>
</template>

<script setup lang="ts" name="debounceDirect">
import { ElMessage } from "element-plus";
import { getCategoryList } from "@/api/modules/category";

const debounceClick = async () => {
  const res = await getCategoryList({ id: null, name: null });
  console.log(res);
  ElMessage.success("防抖指令事件 🍇🍇🍇🍓🍓🍓");
};
</script>

<style scoped lang="scss">
@import "./index.scss";
</style>
